package util;

public class queueUtil {
    private int[] data;
    private int front;
    private int rear;
    private int size;

    public queueUtil(int capacity) {

        data = new int[capacity];
        for(int i=0;i<capacity;i++){
            data[i]=i;
        }
        front = 0;
        rear = capacity-1;
        size = capacity;
    }

    public int dequeue() {
        int item = data[front];
        front = (front + 1) % data.length;
        size--;
        return item;
    }

}
